public class RunningSums{
  public static void main(String[] args){
    int[] nums = {2, 3, 5, 1, 7, 10, 6};
    
    int[] sums = calculateRunningSums(nums);
    System.out.println("\nThe partial sums are: ");
    for(int k = 0; k < sums.length; k++)
      System.out.print(sums[k] + "  ");
  }
  
  public static int[] calculateRunningSums(int[] x){
  	int[] array = new int[x.length];
  	int sum = 0;
  	for(int k = 0; k < x.length; k++){
  		sum += x[k];
  		array[k] = sum;
  	}
  			
  	return array;
  }
}